import api from './auth';

// 获取所有景点类别
export const getAllCategories = () => {
  return api.get('/category/all');
};

// 分页获取景点类别列表
export const getCategoryList = (params) => {
  return api.get('/category/list', { params });
};

// 获取景点类别详情
export const getCategoryById = (categoryId) => {
  return api.get(`/category/${categoryId}`);
};

// 添加景点类别
export const addCategory = (data) => {
  return api.post('/category', data);
};

// 更新景点类别
export const updateCategory = (data) => {
  return api.put('/category', data);
};

// 删除景点类别
export const deleteCategory = (categoryId) => {
  return api.delete(`/category/${categoryId}`);
};

// 上传景点类别封面图片
export const uploadCategoryImage = (formData) => {
  return api.post('/category/upload/cover', formData, {
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
}; 